using System;
using System.Web.UI.WebControls;
using System.Xml.Serialization;

namespace Code5Systems.FormMaster.Business
{

	[Serializable()]public class FMListItem
	{
		
#region Private Members
		private ListItem _listItem;
		private string _category;
#endregion
		
#region Constructors
		public FMListItem()
		{
			_listItem = new ListItem();
		}
		
		public FMListItem(string text)
		{
			_listItem = new ListItem(text);
		}
		
		public FMListItem(string text, string value)
		{
			_listItem = new ListItem(text, value);
		}
		
		public FMListItem(string text, string value, bool enabled)
		{
			_listItem = new ListItem(text, value, enabled);
		}
		
		public FMListItem(string text, string value, string category)
		{
			_listItem = new ListItem(text, value);
			_category = category;
		}
#endregion
		
#region Public Methods
		
		public override bool Equals(object o)
		{
			return _listItem.Equals(o);
		}
		
		public static ListItem FromString(string s)
		{
			return new ListItem(s);
		}
		
		public override int GetHashCode()
		{
			return _listItem.GetHashCode();
		}
		
		public override string ToString()
		{
			return _listItem.ToString();
		}
		
#endregion
		
#region Public Properties

		[XmlIgnore()]
		public System.Web.UI.AttributeCollection Attributes
		{
			get
			{
				return _listItem.Attributes;
			}
		}
		
		[XmlIgnore()]
		public bool Enabled
		{
			get
			{
				return _listItem.Enabled;
			}
			set
			{
				_listItem.Enabled = value;
			}
		}
		
		[XmlAttribute("Selected")]
		public bool Selected
		{
			get
			{
				return _listItem.Selected;
			}
			set
			{
				_listItem.Selected = value;
			}
		}
		
		[XmlAttribute("Text")]
		public string Text
		{
			get
			{
				return _listItem.Text;
			}
			set
			{
				_listItem.Text = value;
			}
		}
		
		[XmlAttribute("Value")]
		public string Value
		{
			get
			{
				return _listItem.Value;
			}
			set
			{
				_listItem.Value = value;
			}
		}
		
		[XmlIgnore()]
		public ListItem ListItem
		{
			get
			{
				return _listItem;
			}
		}
		
		[XmlAttribute("Category")]
		public string Category
		{
			get
			{
				return _category;
			}
			set
			{
				_category = value;
			}
		}
		
#endregion
		
	}
	
}
